package com.demo.user.service.handler.transfer;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.demo.user.entity.DeptInfo;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * @author : YU.TAN
 * @date : 2021/8/27 11:18
 */
@Service
public class DeptInfoTransfer extends BaseTransferProcess<DeptInfo>{

    protected DeptInfoTransfer(BaseMapper<DeptInfo> baseMapper) {
        super(baseMapper);
    }

    @Override
    protected LambdaQueryWrapper<DeptInfo> getQuery(Long userId) {
      return   new LambdaQueryWrapper<DeptInfo>().eq(DeptInfo::getCreateId,userId);
        }

    @Override
    protected DeptInfo getUpdate(Long newUserId) {
        DeptInfo deptInfo=new DeptInfo();
        deptInfo.setCreateId(newUserId);
        deptInfo.setUpdateTime(LocalDateTime.now());
        return deptInfo;
    }
}
